requirejs.config({
    baseUrl : "./js/",
    urlArgs : "va=" + (new Date()).getTime(),
    //paths 只能引入模块 使用了 define
    paths : {
        "jquery" : ["lib/jquery-1.11.1.min"],
        "jquery.validate" : ["lib/jquery.validate"],
        "additional-methods" : ["lib/additional-methods"],
        "yzm" : ["lib/gVerify"],
        "storageTools" : ["storageTools"],
        "jquery.cookie":["lib/jquery.cookie"],
        shim : {
            "yzm" : {
                deps : ["jquery"] // deps 对于当前的非模块的js文件是否依赖其他模块
            }
        }
    }
});
requirejs(["jquery","storageTools","jquery.cookie"], function($, tools){
    var userInfo = null;
    $(function () {
        var jsonStr = sessionStorage.getItem("login");
        console.log(jsonStr);
        userInfo = JSON.parse(jsonStr || '{}');
        if (userInfo.uname != undefined) {
            $(".header .login>span").html("|<a href=\"#\" class='tuichu'>退出</a>\n" +
                "                    |<a href=\"#\">我的账号</a>\n" +
                "                    |<a href=\"car.html\" class=\"icon-czcart\">\n" +
                "                        \n" +
                "                </a>\n" +
                "                    <span class=\"hottel\">\n" +
                "                        <img src=\"img/tel-call.png\" alt=\"\">\n" +
                "                    </span>")
        }
    })
    $(function () {
            $(".newLeft ul li:eq(1)").on("mouseenter",function () {
                $(".productMenu").stop().show(1000);
            });
            $(".newLeft ul li:eq(1)").on("mouseleave",function () {
                $(".productMenu").stop().hide(1000);
            });
            $(".icon-czsousuo").on("click",function () {
                $(".vivo-head").slideToggle(500);
            });
            $(".close").on("click",function () {
                $(".vivo-head").slideUp(500);
            });
            $(".info").on("click",function () {
                $(this).parent().find(".inner").show(1000);
                $(".background").show(500);
            });
            $(".inner span").on("click",function () {
                $(".inner").hide(1000);
                $(".background").hide(500);
            });
            $(".newRight ul li[class=tel]>img").hover(function () {
                $(this).parent().find(".hottel").stop().animate({
                    "opacity":1,
                    "left":-231,
                },500)
            },function () {
                $(this).parent().find(".hottel").stop().animate({
                    "opacity":0,
                    "left":-300,
                },500)
            });
            $(window).scroll(function () {
                // console.log($(window).scrollTop());
                if ($(window).scrollTop()>200){
                    $(".newRight .goTop").stop().fadeIn(1000);
                }else {
                    $(".newRight .goTop").stop().fadeOut(1000);
                }
            });
            $(".newRight .goTop").click(function () {
                $("html,body").animate({"scrollTop":0},500)
            })
        })

})
